package com.hzw.saas.api.product.dto;

import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 购买订单
 * </p>
 *
 * @author zzl
 * @since 2021-01-21
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "购买订单", description = "购买订单")
public class ItemOrderDto implements Serializable {

    private static final long serialVersionUID = 1L;

    public ItemOrderDto() {
    }

    public ItemOrderDto(HpcItemDto item) {
        this.itemId = item.getItemId();
        this.itemName = item.getItemName();
        this.hpcId = item.getHpcId();
        this.itemCoreTime = (double) item.getCoreTime();
        this.itemDatePeriod = item.getDatePeriod();
        this.itemDateUnit = item.getDateUnit();
        this.itemPrice = item.getPrice();
        this.itemPriceDiscount = item.getPriceDiscount();
    }

    /**
     * 订单ID
     */
    @ApiModelProperty(value = "订单ID", position = 1)
    private String orderId;

    /* 商品快照 */

    /**
     * 商品ID
     */
    @ApiModelProperty(value = "商品ID", position = 2)
    private String itemId;

    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称", position = 3)
    private String itemName;

    /**
     * 超算中心ID
     */
    @ApiModelProperty(value = "超算中心ID", position = 4)
    private String hpcId;

    /**
     * 商品核时
     */
    @ApiModelProperty(value = "商品核时", position = 5)
    private Double itemCoreTime;

    /**
     * 商品有效期
     */
    @ApiModelProperty(value = "商品有效期", position = 6)
    private Integer itemDatePeriod;

    /**
     * 商品有效期单位,D/M/S/Y
     */
    @ApiModelProperty(value = "商品有效期单位,D/M/S/Y", position = 7)
    private String itemDateUnit;

    /**
     * 商品价格
     */
    @ApiModelProperty(value = "商品价格", position = 8)
    private Double itemPrice;

    /**
     * 商品优惠价
     */
    @ApiModelProperty(value = "商品优惠价", position = 9)
    private Double itemPriceDiscount;

    /* 商品快照结束 */

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", position = 10)
    private String userId;

    /**
     * 购入机时的超算帐号ID
     */
    @ApiModelProperty(value = "购入机时的超算帐号ID", position = 11)
    private String pid;

    /**
     * 订单创建时间
     */
    @ApiModelProperty(value = "订单创建时间", position = 12)
    private Date createTime;

    /**
     * 订单支付时间
     */
    @ApiModelProperty(value = "订单支付时间", position = 13)
    private Date payTime;

    /**
     * 订单完成时间
     */
    @ApiModelProperty(value = "订单完成时间", position = 14)
    private Date finallyTime;

    /**
     * 订单取消时间
     */
    @ApiModelProperty(value = "订单取消时间", position = 15)
    private Date cancelTime;

    /**
     * 是否支付，0否，1是
     */
    @ApiModelProperty(value = "是否支付，0否，1是", position = 16)
    private Integer isPayed;

    /**
     * 支付模式，1-线上支付，2-线下支付
     */
    @ApiModelProperty(value = "支付模式，1-线上支付，2-线下支付", position = 17)
    private Integer payMode;

    /**
     * 支付模式
     */
    @ApiModelProperty(value = "支付模式", position = 18)
    private String payModeText;

    /**
     * 订单状态
     *
     * @see com.hzw.saas.api.product.enums.OrderStatus
     */
    @ApiModelProperty(value = "订单状态，10-待付款，11-完成", position = 19)
    private Integer status;

    /**
     * 订单状态文本
     */
    @ApiModelProperty(value = "订单状态文本", position = 20)
    private String statusText;

    @ApiModelProperty(value = "销售人名字", position = 21)
    private String salesPeople;

    @ApiModelProperty(value = "销售人电话", position = 22)
    private String salesPhone;

}
